package com.infinitegroup.findmystuff.models;

import java.util.List;
import java.util.Map;

/**
 * Interface to fascilitate the interaction of the item databse and presenters.
 * @author Stephen
 *
 */
public interface Item {
	
	public static final String CATEGORY_PHOTOS = "photos", CATEGORY_JEWELRY = "jewelry", 
			CATEGORY_FURNITURE = "furniture", CATEGORY_ELECTRONICS = "electronics",
			CATEGORY_MISCELLANEOUS = "misc"; 
	
	/**
	 * Inserts a new item for a user
	 * @param username The username of the user whose item is to be inserted
	 */
	public long insertNewItem(String itemname, String location, String reward, String description, String status, String category, String username);
	
	/**
	 * Gets an item from the table
	 * @param itemId the id of the item to be fetched.
	 */
	public Map<String,String> getItem(String itemId);
	
	
	/**
	 * Returns Items filtered by multiple parameters.
	 * @param category - the category to which the items must belong. Use public final strings in this interface.
	 * @param status - Found or Lost. Use public final string.
	 * @param date - true if items are to be sorted in the order they were entered into the database.
	 * @return A list of all items that match the parameters.
	 */
	public List<Map<String, String>> getItemsFilteredBy(String category, String status, boolean date);
	
	/**
	 * This method searched that database and returns all items that match the criteria specified in the arguments.
	 * To not include a criteria in the search, set it to null.
	 * @param itemname - for returning all items that match this itemname. Set null if this is not a criteria for the search
	 * @param location - [algorithm to be determined]
	 * @param status - for returning all items that match this status. Set to null if not a criteria.
	 * @param category - for returning all items that match this category. Set to null if not a criteria.
	 * @param orderBy - the criteria by which result must be ordered. Use Constants for specifying order.
	 * @return A list of all Items (as maps) that match this criteria
	 */
	public List<Map<String, String>> getItemsFilteredBy(String itemname, String location, String status, String category, String orderBy);
	
}
